from auto_taomengmeng.day5.autoframe.common.base import Base, By


class LoginPage(Base):
    def input_username(self, locator, username):
        self.find_element(locator).send_keys(username)

    def input_password(self, locator, password):
        self.find_element(locator).send_keys(password)

    def remember(self, locator):
        self.click(locator)

    def btn_login(self, locator):
        self.click(locator)


if __name__ == '__main__':
    #测试执行用例
    login = LoginPage('chrome')
    login.get('https://ecshop.test2.shopex123.com/user.php')
    login.input_username((By.NAME, 'username'), 'fine1')
    login.input_password((By.NAME, 'password'), '123456')
    login.btn_login((By.NAME, 'submit'))
